package servicesImp.specific;


import base.response.OffsetLimitPage;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import services.specific.AnnualAssessServices;
import wt.dao.specific.AnnualAssessMapper;
import wt.entity.specific.AnnualAssess;

import java.util.Date;
import java.util.List;


/**
 * Created by Administrator on 2017/9/13.
 */
@Service
public class AnnualAssessServicesImp implements AnnualAssessServices {

    @Autowired
    AnnualAssessMapper annualAssessMapper;

    public List<AnnualAssess> select(String expertName, String itemId, String itemTypeOverdueId, Date startTime, Date endTime,String affiliate) throws Exception {
        return annualAssessMapper.select(expertName, itemId, itemTypeOverdueId, startTime, endTime,affiliate);
    }

    public OffsetLimitPage select(String expertName, String itemId, String itemTypeOverdueId, Date startTime, Date endTime,String affiliate, Integer offset, Integer limit) throws Exception {
        PageHelper.offsetPage(offset, limit);
        List<AnnualAssess> annualAssessList = annualAssessMapper.select(expertName, itemId, itemTypeOverdueId, startTime, endTime,affiliate);
        return new OffsetLimitPage((Page) annualAssessList);
    }
}
